#include <unordered_map>
using namespace std;

class Solution
{
public:
    unordered_map<int, int> map;
    int minDays(int n)
    {
        if (n <= 1)
        {
            return n;
        }
        if (map.count(n))
        {
            return map[n];
        }
        return map[n] = min(n % 2 + 1 + minDays(n / 2), n % 3 + 1 + minDays(n / 3));
    }
};
int main(int argc, char const *argv[])
{

    return 0;
}
